package com.example.demo.ProxyMode;

/**
 * 代练者
 */
public class GamePlayerProxy implements IGamePlayer{

    private IGamePlayer iGamePlayer;

    public GamePlayerProxy(IGamePlayer iGamePlayer){
        this.iGamePlayer = iGamePlayer;
    }

    public GamePlayerProxy(String name){
        try {
            iGamePlayer = new GamePlayer(this,name);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    @Override
    public void login(String user, String password) {
        this.iGamePlayer.login(user,password);
    }

    @Override
    public void killBoss() {
        this.iGamePlayer.killBoss();
    }

    @Override
    public void upgrade() {
        this.iGamePlayer.upgrade();
    }
}
